#!/bin/bash
#Check user password, set the number can be retrying.
NUM=3                         	#密码最多尝试次数
PASSWD=Jacob                	#初始密码
SUM=0                          	#计数器
while true
do
read -p "Please input your password:" pass   	#读取用户输入
SUM=$((SUM+1))                                    	#计数器加1
if [ $pass == $PASSWD ] ; then                	#判断密码是否正确
	echo "Your Are Right, OK"
	exit
elif [ $SUM -lt 3 ] ; then                		#判断密码尝试次数
	continue
else
	exit
fi
done
